package com.huilian.iotbox.admin.quartz.job;

import com.huilian.iotbox.admin.service.MessageLogService;
import com.huilian.iotbox.data.utils.DateTimeUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 定时删除设备收、发消息内容
 * @author chenqiwen
 * @CreateDate: 2022-01-19-14-05
 * @Description:
 */
public class ClearDataByMessageLog implements BaseJob {

    @Autowired
    private MessageLogService messageLogService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

        String endDateTime = DateTimeUtils.getSomeDaysAgo(3);
        messageLogService.deleteDataBySection(endDateTime);
    }
}
